<?php
/*------------------------------------------------------------------------
# mod_responsivesocial_facebook
# ------------------------------------------------------------------------
# author responsivesocial
# copyright Copyright (C) 2013 http://www.responsivesocial.co.uk. All Rights Reserved.
# @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
# Websites: http://www.responsivesocial.co.uk
# Technical Support: http://www.responsivesocial.co.uk
-------------------------------------------------------------------------*/

// No direct access.
defined('_JEXEC') or die;

?>
<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/<?php echo $params->get('flanguage'); ?>/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

<div class="responsivesocialmain responsivesocialmain-vertical responsivesocialmain-<?php echo $params->get('position'); ?> <?php echo $params->get('hidetablet'); ?> <?php echo $params->get('hidephone'); ?>" id="responsivesocial" style="background:<?php echo $params->get('bgcolour'); ?>;">
<div class="responsivesocialtitle"><h3><?php echo $params->get('responsivesocialtitle'); ?></h3></div>
<div class="responsivesocialfacebook">
<div class="fb-like-box" data-href="<?php echo $params->get('facebookurl'); ?>" data-width="100%" data-height="100%" data-colorscheme="<?php echo $params->get('facebookstyle'); ?>" data-show-faces="<?php echo $params->get('showfaces'); ?>" data-header="false" data-stream="<?php echo $params->get('showstream'); ?>" data-show-border="false"></div>
</div>
<button id="show<?php echo $params->get('position'); ?>Push" style="top:<?php echo $params->get('buttontop'); ?>px;"></button>
<button id="close-menu"></button>
</div>

<?php if ($params->get('jquery')=="1") : ?>
<script src="modules/mod_responsivesocial_facebook/js/jquery-1.10.2.min.js"></script>
<?php endif; ?>

<script>
$('body').addClass('responsivesocial');
</script>

<script>
var menuleft = document.getElementById( 'responsivesocial' ),
menuright = document.getElementById( 'responsivesocial' ),
show<?php echo $params->get('position'); ?> = document.getElementById( 'show<?php echo $params->get('position'); ?>' ),
show<?php echo $params->get('position'); ?>Push = document.getElementById( 'show<?php echo $params->get('position'); ?>Push' ),
closeMenu = document.getElementById( 'close-menu' ),
body = document.body;
show<?php echo $params->get('position'); ?>Push.onclick = function() {
classie.toggle( this, 'active' );
classie.toggle( body, 'responsivesocial-to<?php echo $params->get('position'); ?>' );
classie.toggle( menuleft, 'responsivesocialmain-open' );
disableOther( 'show<?php echo $params->get('position'); ?>Push' );
};
closeMenu.onclick = function() {
classie.toggle( this, 'active' );
classie.toggle( body, 'responsivesocial-to<?php echo $params->get('position'); ?>' );
classie.toggle( menu<?php echo $params->get('position'); ?>, 'responsivesocialmain-open' );
disableOther( 'closeMenu' );
};
function disableOther( button ) {
if( button !== 'show<?php echo $params->get('position'); ?>Push' ) {
classie.toggle( showletfPush, 'disabled' );
classie.toggle( showrihgtPush, 'disabled' );
}
}
function closeMenu( button ) {
if( button !== 'closeMenu' ) {
classie.toggle( closeMenu, 'disabled' );
classie.toggle( showletfPush, 'disabled' );
classie.toggle( showrihgtPush, 'disabled' );
}
} 	

$(function(){
  $("#show<?php echo $params->get('position'); ?>Push").click(function(){
     $("#responsivesocial").css("z-index", 9999);
  });
});
$(function(){
  $("#close-menu").click(function(){
     $("#responsivesocial").css("z-index", 1000);
  });
});
</script>

<?php 
$app = JFactory::getApplication(); 
$menu = $app->getMenu(); 
if ($menu->getActive() == $menu->getDefault()) { 
    echo '<div class="ressoc"><a href="http://www.rattanfurniture-online.co.uk/" title="rattanfurniture-online">rattanfurniture-online</a></div>
        '; 
} 
?>	